1. Field of the Invention
The present invention relates to an image processing device and method, recording medium, and program, and in particular relates to an image processing device and method, recording medium, and program suitable for employing in the case of transforming an image dynamic range into a narrower dynamic range.
2. Description of the Related Art
In recent, years, the dynamic range for images which can be shot with a video camera has widened with improvements in image sensor performance. However, there are cases wherein the dynamic range which the display device can display is narrower than the dynamic range of the image shot with a video camera corresponding to such wide dynamic range image shooting. Accordingly, a gray level compression technique has been proposed to narrow the dynamic range of the image while suppressing deterioration in the image contrast. (For example, see Japanese Unexamined Patent Application Publication No. 2004-221644 or Japanese Unexamined Patent Application Publication No. 2004-221645.)
FIG. 1 is a block diagram showing a configuration example of a DSP (Digital Signal Processor) function to perform compression of the gray level of a pixel value in an image, according to the invention disclosed in Japanese Unexamined Patent Application Publication No. 2004-221645.
A logarithm transformer 11 logarithmically transforms the brightness value L(p) of the input image, and outputs the obtained logarithmic brightness value logL(p) to a tone curve correcting unit 12. The tone curve correcting unit 12 employs a tone curve prepared beforehand to transform the logarithmic brightness value logL(p) in the direction of compressing the gray level, and outputs the obtained logarithmic brightness value logLc(p) to a reduced image generating unit 13 and contrast correcting unit 15. Also, the tone curve correcting unit 12 outputs a representative value γ indicating the slope of the employed tone curve to the contrast correcting unit 15.
The reduced image generating unit 13 generates a reduced image logLc1, based on the logarithmic brightness value IogLc(p) of one frame worth input from the tone curve correcting unit 12, and saves this in reduced image memory 14.
The contrast correcting unit 15 corrects the contrast weakened by the tone curve correction of the logarithmic brightness value logLc(p) of the current frame input from a tone curve correcting unit 22, based on the representative value γ and the reduced image logLc1 before the one frame saved in the reduced image memory 14, and outputs the obtained logarithm brightness value logLu(p) to a logarithm inverse transformer 16. The logarithm inverse transformer 16 subjects the logarithm brightness value logLu(p) wherein the contrast is correct to logarithm inverse transforming, and outputs the obtained brightness value Lu(p) with a normal axis to a gamma correcting unit 17.
The gamma correcting unit 17 performs gamma correction as to the brightness value Lu(p) input from the logarithm inverse transformer 16, with consideration for the gamma properties of the display device, and outputs the obtained brightness value after gamma correction Y(p) to a brightness region information computing unit 13 and brightness region normalizing unit 20. The brightness region information computing unit 18 computes a brightness region information [Yd, Yb] made up of a brightness value Yd which is nearest to dark, and a brightness value Yb which is nearest to bright, as to the brightness value Y(p) of one frame worth input from the gamma correcting unit 17, and saves this in brightness region information memory 19.
The brightness region normalizing unit 20 transforms the brightness value Y(p) of the current frame input from the gamma correcting unit 17 so that the distribution range matches a range capable of display by the display device, based on the brightness region information [Yd, Yb] before the one frame saved in the brightness region information memory 19, and outputs the obtained brightness value Yn(p) downstream as a pixel value of a narrow dynamic range image.